<template>
  <view>
    <mchItem v-for="item in data.list" :key="item.id" :item="item"></mchItem>
  </view>
</template>

<script lang="ts" setup>
import { api } from '@/api/mop_api';
import { reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { err, toast } from '@/utils/uniapi';
const data = reactive({
  list: []
});
onLoad(() => {
  getList();
});
async function getList() {
  try {
    const { respCode, msg, source } = await api.mopList();
    if (respCode === 200) {
      const list = JSON.parse(source);
      console.log(list)
      data.list = list;
    } else {
      toast(msg);
    }
  } catch (e) {
    err(e);
  }
}
</script>

<style scoped lang="scss"></style>
